<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  
  <title>package | ryansecreat blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Opn: A better node-open. Opens stuff like websites, files, executables. Cross-platform. Ora:进度条和文字。 joi：数据验 satisfies ：版本工具 minimist：简单的参数处理 read-pkg:规范化解析pkg inquirer:询问时可以给出选项 Resovel:解析包的安装路径 slas">
<meta name="keywords" content="useful package">
<meta property="og:type" content="article">
<meta property="og:title" content="package">
<meta property="og:url" content="http://yoursite.com/2019/02/14/package/index.html">
<meta property="og:site_name" content="ryansecreat blog">
<meta property="og:description" content="Opn: A better node-open. Opens stuff like websites, files, executables. Cross-platform. Ora:进度条和文字。 joi：数据验 satisfies ：版本工具 minimist：简单的参数处理 read-pkg:规范化解析pkg inquirer:询问时可以给出选项 Resovel:解析包的安装路径 slas">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-11-26T03:09:48.820Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="package">
<meta name="twitter:description" content="Opn: A better node-open. Opens stuff like websites, files, executables. Cross-platform. Ora:进度条和文字。 joi：数据验 satisfies ：版本工具 minimist：简单的参数处理 read-pkg:规范化解析pkg inquirer:询问时可以给出选项 Resovel:解析包的安装路径 slas">
  
    <link rel="alternate" href="/atom.xml" title="ryansecreat blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  

  
  <link rel="stylesheet" href="/css/style.css">
  

</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">ryansecreat blog</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">smile hard</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-package" class="article article-type-post" itemscope="" itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/02/14/package/" class="article-date">
  <time datetime="2019-02-14T09:19:12.000Z" itemprop="datePublished">2019-02-14</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      package
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <ol>
<li>Opn: A better node-open. Opens stuff like websites, files, executables. Cross-platform.</li>
<li>Ora:进度条和文字。</li>
<li>joi：数据验</li>
<li>satisfies ：版本工具</li>
<li>minimist：简单的参数处理</li>
<li>read-pkg:规范化解析pkg</li>
<li>inquirer:询问时可以给出选项</li>
<li>Resovel:解析包的安装路径</li>
<li>slash:Convert Windows backslash paths to slash paths: foo\bar ➔ foo/bar</li>
<li>klaw-sync:回遍历出所有文件，并返回文件路径和文件夹</li>
<li>mime-types content-type 工具：1. 可以根据文件后缀获取 2. 根据content-type获取charset 3. 根据content-type 获取默认的文件名</li>
<li>CodeMirror是一个运行在浏览器中的在线代码编辑器，支持100多种语言，高度可定制。</li>
<li>@typescript-eslint/eslint-plugin.  eslint 检测typescript </li>
<li>nanoid  A tiny, secure, URL-friendly, unique string ID generator for JavaScript.</li>
<li>mm 对mudule 中的方法mock</li>
<li><p>numerify  用来格式化数字 </p>
</li>
<li><p>utils-lite  前端提供debounce、thorttling、clone、cloneDeep 等方法</p>
</li>
<li>is-type-of   node check 数据类型</li>
<li>on-finished  Execute a callback when a HTTP request closes, finishes, or errors</li>
<li><p>await-event  封装了promise </p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> PassThrough = <span class="built_in">require</span>(<span class="string">'stream'</span>).PassThrough</span><br><span class="line"> </span><br><span class="line"><span class="keyword">var</span> stream = <span class="keyword">new</span> PassThrough()</span><br><span class="line"><span class="comment">// you attach it directly on an event emitter</span></span><br><span class="line">stream.await = <span class="built_in">require</span>(<span class="string">'await-event'</span>)</span><br><span class="line"> </span><br><span class="line">co(<span class="function"><span class="keyword">function</span>* (<span class="params"></span>) </span>&#123;</span><br><span class="line">  <span class="keyword">var</span> chunk = <span class="keyword">yield</span> stream.await(<span class="string">'data'</span>)</span><br><span class="line">  <span class="keyword">var</span> chunk = <span class="keyword">yield</span> stream.await(<span class="string">'data'</span>)</span><br><span class="line">  <span class="keyword">var</span> chunk = <span class="keyword">yield</span> stream.await(<span class="string">'data'</span>)</span><br><span class="line">&#125;).catch(noop)</span><br><span class="line"> </span><br><span class="line">stream.write(<span class="string">'some chunk’)</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>get-ready  NodeJS mixin to add one-time ready event</p>
</li>
<li>ShellJS 是Unix shell命令在Node.js API上的可移植实现</li>
<li>graceful-process   graceful exit process even parent exit on SIGKILL.</li>
<li>semver.gte(process.version, ‘7.0.0’)  版本的比对 </li>
<li>pkgfiles  自动再package中添加 npm publish 文件</li>
<li>depd  标注方法deprecating </li>
<li>http-errors   http错误  </li>
<li>Global-tunnel  http请求的全局代理  </li>
<li><p>humanize-ms  转义为ms  </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">transform humanize time to ms  ms(&apos;1s&apos;) // 1000</span><br><span class="line">ms(1000) // 1000</span><br></pre></td></tr></table></figure>
</li>
<li><p>Exceljs 一个功能强大的excel 处理包</p>
</li>
<li>ready-callback 所有注册的事件完成后，才执行ready中方法</li>
<li>Get-ready  NodeJS mixin to add one-time ready event，ready 后执行相关方法</li>
<li>xml2js  将xml 转换为json </li>
<li>debug  调试状态输出  debug=<em>  debug=work:</em>   </li>
<li>delegates  node模块中代理proto中属性的方法、setter和getter</li>
<li>chokidar filewatch </li>
<li>Puppeteer  headless browser</li>
<li>cross-env Run scripts that set and use environment variables across platforms</li>
<li>simplemde  markdown editor </li>
<li><p>serialize-javascript  Serialize JavaScript to a superset of JSON that includes regular expressions and functions.<br>1.route-cache  express router cache</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> routeCache = <span class="built_in">require</span>(<span class="string">'route-cache'</span>);</span><br><span class="line"> </span><br><span class="line"><span class="comment">// cache route for 20 seconds</span></span><br><span class="line">app.get(<span class="string">'/index'</span>, routeCache.cacheSeconds(<span class="number">20</span>), <span class="function"><span class="keyword">function</span>(<span class="params">req, res</span>)</span>&#123;</span><br><span class="line">  <span class="comment">// do your dirty work here...</span></span><br><span class="line">  <span class="built_in">console</span>.log(<span class="string">'you will only see this every 20 seconds.'</span>);</span><br><span class="line">  res.send(<span class="string">'this response will be cached'</span>);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>
</li>
<li><p>Ws server 端的websoket </p>
</li>
<li>fastclick  解决浏览器点击的延迟</li>
<li>Qs  A querystring parsing and stringifying library with some added security.</li>
<li>lru-cache  A cache object that deletes the least-recently-used items.</li>
<li>memory-fs  A simple in-memory filesystem. Holds data in a javascript object</li>
<li>faker.js  generate massive amounts of fake data in the browser and node.js</li>
<li>parseurl 等同node url parse，加了cache</li>
<li>vue-lazy-component   Vue.js 2.x 组件级懒加载方案-Vue.js 2.x component level lazy loading solution</li>
<li>async-validator  数据验证</li>
<li>fast-safe-stringify    Safe and fast serialization alternative to JSON.stringify.</li>
<li>node-notifier   Send cross platform native notifications using Node.js.</li>
<li>dateformat   node 时间处理函数</li>
<li>agentkeepalive  defaut is keepalive</li>
<li>copy-to   copy an object’s properties to another one, include propertiy, getter and setter.</li>
<li><p>platform   A platform detection library that works on nearly all JavaScript platforms.</p>
</li>
<li><p>svg-captcha 验证码  </p>
</li>
<li>vue-virtual-scroller  加载大量数据</li>
</ol>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/02/14/package/" data-id="ck3ya0yib000n0d8sbtp3hwbc" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/useful-package/">useful package</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/02/20/gitInfo/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          gitInfo
        
      </div>
    </a>
  
  
    <a href="/2017/02/21/postgre/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">postgre</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/css/">css</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/es/">es</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/eslint/">eslint</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/http/">http</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/https/">https</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/interview/">interview</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/loadtest/">loadtest</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ops/">ops</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pattern/">pattern</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/pm2/">pm2</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgre/">postgre</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/regex/">regex</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ts/">ts</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/useful-package/">useful package</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vue-eventloop-js/">vue eventloop js</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web-安全/">web 安全</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webpack/">webpack</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/安全/">安全</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/零碎/">零碎</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/css/" style="font-size: 10px;">css</a> <a href="/tags/docker/" style="font-size: 10px;">docker</a> <a href="/tags/es/" style="font-size: 20px;">es</a> <a href="/tags/eslint/" style="font-size: 10px;">eslint</a> <a href="/tags/git/" style="font-size: 10px;">git</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/http/" style="font-size: 10px;">http</a> <a href="/tags/https/" style="font-size: 10px;">https</a> <a href="/tags/interview/" style="font-size: 10px;">interview</a> <a href="/tags/loadtest/" style="font-size: 10px;">loadtest</a> <a href="/tags/ops/" style="font-size: 10px;">ops</a> <a href="/tags/pattern/" style="font-size: 10px;">pattern</a> <a href="/tags/pm2/" style="font-size: 10px;">pm2</a> <a href="/tags/postgre/" style="font-size: 10px;">postgre</a> <a href="/tags/regex/" style="font-size: 10px;">regex</a> <a href="/tags/ts/" style="font-size: 10px;">ts</a> <a href="/tags/useful-package/" style="font-size: 10px;">useful package</a> <a href="/tags/vue-eventloop-js/" style="font-size: 10px;">vue eventloop js</a> <a href="/tags/web-安全/" style="font-size: 10px;">web 安全</a> <a href="/tags/webpack/" style="font-size: 10px;">webpack</a> <a href="/tags/安全/" style="font-size: 10px;">安全</a> <a href="/tags/零碎/" style="font-size: 10px;">零碎</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">May 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/02/">February 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/">January 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/12/">December 2016</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/12/09/security-1/">security</a>
          </li>
        
          <li>
            <a href="/2019/11/08/encoding/">encoding</a>
          </li>
        
          <li>
            <a href="/2019/08/23/graphql/">graphql</a>
          </li>
        
          <li>
            <a href="/2019/07/02/linux/">linux</a>
          </li>
        
          <li>
            <a href="/2019/07/02/es8/">es8</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 ryansecreat<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>